package com.itsm.example.incident.flow.bo;

import com.itsm.example.audit.pojo.event.AuditEvent;
import com.itsm.example.statemachine.bo.ItsmEvent;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.SuperBuilder;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Data
public class IncidentEvent extends ItsmEvent {



    IncidentEvent(Integer id, String name,String jsForm) {
        super.setId(id);
        super.setName(name);
        super.setJsForm(jsForm);
    }

    public static IncidentEvent SUBMIT = new IncidentEvent(10,"提交","newJs");
    public static IncidentEvent ASSIGN = new IncidentEvent(20,"分派","newJs");
    public static IncidentEvent SOLVED = new IncidentEvent(30,"解决","newJs");
    public static IncidentEvent VALIDATE = new IncidentEvent(40,"验证","newJs");
    public static IncidentEvent CLOSE = new IncidentEvent(50,"关闭","newJs");


    public static final Map<Integer, IncidentEvent> CODE_MAP = new ConcurrentHashMap<>();

    static {
        CODE_MAP.put(10, SUBMIT);
        CODE_MAP.put(20, ASSIGN);
        CODE_MAP.put(30, SOLVED);
        CODE_MAP.put(40, VALIDATE );
        CODE_MAP.put(50, CLOSE);
    }


//    public static IncidentState NEW = new IncidentState(10,"新建");
//    public static IncidentState FIRST_LINE_ASSIGN = new IncidentState(16,"待分派-一线");
////    public static IncidentState SUB_COMPANY_ASSIGN = new IncidentState(21,"待受理-分公司");
////    public static IncidentState DESKTOP_ASSIGN = new IncidentState(22,"待受理-桌面组");
////    public static IncidentState DEVOPS_ASSIGN = new IncidentState(23,"待受理-运维组");
////    public static IncidentState BUSINESS = new IncidentState(31,"寿险业务工单处理中");
////    public static IncidentState CLOUD = new IncidentState(32,"云平台处理中");
////    public static IncidentState SUB_COMPANY = new IncidentState(33,"处理中-分公司");
////    public static IncidentState DESKTOP = new IncidentState(34,"处理中-桌面组");
////    public static IncidentState DEVOPS = new IncidentState(35,"处理中-运维组");
//    public static IncidentState FIRST_LINE = new IncidentState(36,"处理中-一线");
//    public static IncidentState USER_VALIDATE = new IncidentState(51,"用户验证");
//    public static IncidentState PENDING_CALLBACK = new IncidentState(52,"待回访");
//    public static IncidentState WAIT = new IncidentState(55,"等待");
//    public static IncidentState CLOSE = new IncidentState(60,"已关闭");


    @Override
    public String  toString() {
        return "IncidentEvent{" +
                "id=" + getId() +
                ", desc='" + getName() + '\'' +
                ", jsForm='" + getJsForm() + '\'' +
                '}';
    }
}
